import request from '@/utils/request'

enum api {
  menuList = '/admin/acl/permission',
  save = '/admin/acl/permission/save',
  update = '/admin/acl/permission/update',
  delete = '/admin/acl/permission/remove/',
}

export const reqMenuList = () => request.get(api.menuList)
export const reqSaveOrUpdate = (data: any) => {
  if (data.id) {
    return request.put(api.update, data)
  } else {
    return request.post(api.save, data)
  }
}
export const reqRemove = (data: any) => request.delete(api.delete + data)
